﻿<UserControl x:Class="SPNetworkTopology.ExternalWindows.View.SPColumnSelectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:res="clr-namespace:SPNetworkTopology"
             mc:Ignorable="d">
    <UserControl.Resources>
        <Style x:Key="ListBoxStyle" TargetType="{x:Type CheckBox}">
            <Setter Property="FontWeight" Value="Normal" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=DisplayName}" Value="Select All">
                    <Setter Property="FontWeight" Value="Bold" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=DisplayName}" Value="Server Name">
                    <Setter Property="IsEnabled" Value="False" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=DisplayName}" Value="Object Type">
                    <Setter Property="IsEnabled" Value="False" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=DisplayName}" Value="Service Name">
                    <Setter Property="IsEnabled" Value="False" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="20"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="20"></RowDefinition>
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0" Text="{x:Static res:SPNetworkTopologyResource.SharePointColumnsSelectionBlurb}" TextWrapping="Wrap" TextAlignment="Justify" />

        <Border Grid.Row="1"/>

        <ListBox Grid.Row="2" Name="SPColumnListBox" SelectionMode="Multiple" Background="{x:Null}" BorderBrush="#FFE2B47D" ItemsSource="{Binding Path=SPColumnCollection}" Grid.RowSpan="2" MaxHeight="210">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Path=IsSelected}" Content="{Binding Path=DisplayName}" Style="{StaticResource ResourceKey=ListBoxStyle}"></CheckBox>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Border Grid.Row="3"/>
    </Grid>
</UserControl>
